package com.lagou.edu.service.impl;

import com.lagou.edu.pojo.Resume;
import com.lagou.edu.repository.ResumeRepository;
import com.lagou.edu.service.ResumeService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author leonzhangxf
 */
@Service
public class ResumeServiceImpl implements ResumeService {

    private final ResumeRepository resumeRepository;

    public ResumeServiceImpl(ResumeRepository resumeRepository) {
        this.resumeRepository = resumeRepository;
    }

    @Override
    public List<Resume> list() {
        return resumeRepository.findAll();
    }

    @Override
    public void create(Resume resume) {
        resumeRepository.save(resume);
    }

    @Override
    public void update(Resume resume) {
        resumeRepository.save(resume);
    }

    @Override
    public void delete(Long resumeId) {
        resumeRepository.deleteById(resumeId);
    }
}
